\hypertarget{class_sqlite_wrapper}{\section{Sqlite\+Wrapper类 参考}
\label{class_sqlite_wrapper}\index{Sqlite\+Wrapper@{Sqlite\+Wrapper}}
}


Sqlite包装器类  




{\ttfamily \#include $<$Sqlite\+Wrapper.\+h$>$}

类 Sqlite\+Wrapper 继承关系图\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{class_sqlite_wrapper}
\end{center}
\end{figure}
\subsection*{Public 成员函数}
\begin{DoxyCompactItemize}
\item 
sint32 \hyperlink{class_sqlite_wrapper_a40c6f1a1b1653d32f78e278b38add84f}{open} (std\+::string db\+Name)
\begin{DoxyCompactList}\small\item\em 打开数据库 \end{DoxyCompactList}\item 
sint32 \hyperlink{class_sqlite_wrapper_ad4c51d552be628cb7cbeb234d1095cc1}{connect} (std\+::string user, std\+::string passwd)
\begin{DoxyCompactList}\small\item\em 连接数据库 \end{DoxyCompactList}\item 
sint32 \hyperlink{class_sqlite_wrapper_afb5508c06124105cbb102539f8da8b94}{close} ()
\begin{DoxyCompactList}\small\item\em 关闭数据库 \end{DoxyCompactList}\item 
sint32 \hyperlink{class_sqlite_wrapper_a72f83af87d07cf115c814d6bb7c7d8c0}{exec} (const std\+::string \&sql, \hyperlink{struct_sql_result___s}{Sql\+Result\+\_\+\+S} $\ast$result=N\+U\+L\+L)
\begin{DoxyCompactList}\small\item\em 执行\+S\+Q\+L语句 \end{DoxyCompactList}\item 
sint32 \hyperlink{class_sqlite_wrapper_aa40cec147c960cc50f6992cca08760ab}{insert\+Blob} (const std\+::string \&sql, std\+::string bind\+Var\+Name, char $\ast$buf, sint32 len)
\begin{DoxyCompactList}\small\item\em 插入二进制数据 \end{DoxyCompactList}\item 
sint32 \hyperlink{class_sqlite_wrapper_ac45299aabcf122467fa7b91028895c76}{select\+Blob} (const std\+::string \&sql, std\+::string bind\+Var\+Name, char $\ast$buf, sint32 \&len)
\begin{DoxyCompactList}\small\item\em 读取二进制数据 \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{详细描述}
Sqlite包装器类 

\subsection{成员函数说明}
\hypertarget{class_sqlite_wrapper_afb5508c06124105cbb102539f8da8b94}{\index{Sqlite\+Wrapper@{Sqlite\+Wrapper}!close@{close}}
\index{close@{close}!Sqlite\+Wrapper@{Sqlite\+Wrapper}}
\subsubsection[{close}]{\setlength{\rightskip}{0pt plus 5cm}sint32 Sqlite\+Wrapper\+::close (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{class_sqlite_wrapper_afb5508c06124105cbb102539f8da8b94}


关闭数据库 


\begin{DoxyParams}{参数}
{\em void} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回\+S\+T\+A\+T\+U\+S\+\_\+\+O\+K,失败返回\+S\+T\+A\+T\+U\+S\+\_\+\+E\+R\+R\+O\+R 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}


实现了 \hyperlink{class_data_base}{Data\+Base}.

\hypertarget{class_sqlite_wrapper_ad4c51d552be628cb7cbeb234d1095cc1}{\index{Sqlite\+Wrapper@{Sqlite\+Wrapper}!connect@{connect}}
\index{connect@{connect}!Sqlite\+Wrapper@{Sqlite\+Wrapper}}
\subsubsection[{connect}]{\setlength{\rightskip}{0pt plus 5cm}sint32 Sqlite\+Wrapper\+::connect (
\begin{DoxyParamCaption}
\item[{std\+::string}]{user, }
\item[{std\+::string}]{passwd}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{class_sqlite_wrapper_ad4c51d552be628cb7cbeb234d1095cc1}


连接数据库 


\begin{DoxyParams}{参数}
{\em user} & 用户名 \\
\hline
{\em passwd} & 密码 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回\+S\+T\+A\+T\+U\+S\+\_\+\+O\+K,失败返回\+S\+T\+A\+T\+U\+S\+\_\+\+E\+R\+R\+O\+R 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}


实现了 \hyperlink{class_data_base}{Data\+Base}.

\hypertarget{class_sqlite_wrapper_a72f83af87d07cf115c814d6bb7c7d8c0}{\index{Sqlite\+Wrapper@{Sqlite\+Wrapper}!exec@{exec}}
\index{exec@{exec}!Sqlite\+Wrapper@{Sqlite\+Wrapper}}
\subsubsection[{exec}]{\setlength{\rightskip}{0pt plus 5cm}sint32 Sqlite\+Wrapper\+::exec (
\begin{DoxyParamCaption}
\item[{const std\+::string \&}]{sql, }
\item[{{\bf Sql\+Result\+\_\+\+S} $\ast$}]{result = {\ttfamily NULL}}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{class_sqlite_wrapper_a72f83af87d07cf115c814d6bb7c7d8c0}


执行\+S\+Q\+L语句 


\begin{DoxyParams}{参数}
{\em sql} & S\+Q\+L语句 \\
\hline
{\em result} & S\+Q\+L执行结果 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回\+S\+T\+A\+T\+U\+S\+\_\+\+O\+K,失败返回\+S\+T\+A\+T\+U\+S\+\_\+\+E\+R\+R\+O\+R 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
none 
\end{DoxyNote}


实现了 \hyperlink{class_data_base}{Data\+Base}.

\hypertarget{class_sqlite_wrapper_aa40cec147c960cc50f6992cca08760ab}{\index{Sqlite\+Wrapper@{Sqlite\+Wrapper}!insert\+Blob@{insert\+Blob}}
\index{insert\+Blob@{insert\+Blob}!Sqlite\+Wrapper@{Sqlite\+Wrapper}}
\subsubsection[{insert\+Blob}]{\setlength{\rightskip}{0pt plus 5cm}sint32 Sqlite\+Wrapper\+::insert\+Blob (
\begin{DoxyParamCaption}
\item[{const std\+::string \&}]{sql, }
\item[{std\+::string}]{bind\+Var\+Name, }
\item[{char $\ast$}]{buf, }
\item[{sint32}]{len}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{class_sqlite_wrapper_aa40cec147c960cc50f6992cca08760ab}


插入二进制数据 


\begin{DoxyParams}{参数}
{\em sql} & S\+Q\+L插入语句 \\
\hline
{\em bind\+Var\+Name} & 绑定变量名,格式为\char`\"{}\+:name\char`\"{} \\
\hline
{\em buf} & 数据缓存 \\
\hline
{\em len} & 数据长度 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回\+S\+T\+A\+T\+U\+S\+\_\+\+O\+K,失败返回\+S\+T\+A\+T\+U\+S\+\_\+\+E\+R\+R\+O\+R 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
每次只允许插入一条记录 
\end{DoxyNote}


实现了 \hyperlink{class_data_base}{Data\+Base}.

\hypertarget{class_sqlite_wrapper_a40c6f1a1b1653d32f78e278b38add84f}{\index{Sqlite\+Wrapper@{Sqlite\+Wrapper}!open@{open}}
\index{open@{open}!Sqlite\+Wrapper@{Sqlite\+Wrapper}}
\subsubsection[{open}]{\setlength{\rightskip}{0pt plus 5cm}sint32 Sqlite\+Wrapper\+::open (
\begin{DoxyParamCaption}
\item[{std\+::string}]{db\+Name}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{class_sqlite_wrapper_a40c6f1a1b1653d32f78e278b38add84f}


打开数据库 


\begin{DoxyParams}{参数}
{\em db\+Name} & 数据库名字 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回\+S\+T\+A\+T\+U\+S\+\_\+\+O\+K,失败返回\+S\+T\+A\+T\+U\+S\+\_\+\+E\+R\+R\+O\+R 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
如果db\+Name=\char`\"{}\+:memory\char`\"{},表示打开内存数据库 
\end{DoxyNote}


实现了 \hyperlink{class_data_base}{Data\+Base}.

\hypertarget{class_sqlite_wrapper_ac45299aabcf122467fa7b91028895c76}{\index{Sqlite\+Wrapper@{Sqlite\+Wrapper}!select\+Blob@{select\+Blob}}
\index{select\+Blob@{select\+Blob}!Sqlite\+Wrapper@{Sqlite\+Wrapper}}
\subsubsection[{select\+Blob}]{\setlength{\rightskip}{0pt plus 5cm}sint32 Sqlite\+Wrapper\+::select\+Blob (
\begin{DoxyParamCaption}
\item[{const std\+::string \&}]{sql, }
\item[{std\+::string}]{bind\+Var\+Name, }
\item[{char $\ast$}]{buf, }
\item[{sint32 \&}]{len}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{class_sqlite_wrapper_ac45299aabcf122467fa7b91028895c76}


读取二进制数据 


\begin{DoxyParams}{参数}
{\em sql} & S\+Q\+L查询语句 \\
\hline
{\em bind\+Var\+Name} & 绑定变量名,格式为\char`\"{}\+:name\char`\"{} \\
\hline
{\em buf} & 数据缓存 \\
\hline
{\em len} & 数据长度 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
成功返回\+S\+T\+A\+T\+U\+S\+\_\+\+O\+K,失败返回\+S\+T\+A\+T\+U\+S\+\_\+\+E\+R\+R\+O\+R 
\end{DoxyReturn}
\begin{DoxyNote}{注解}
每次只允许读取一条记录 
\end{DoxyNote}


实现了 \hyperlink{class_data_base}{Data\+Base}.



该类的文档由以下文件生成\+:\begin{DoxyCompactItemize}
\item 
libemb/inc/\hyperlink{_sqlite_wrapper_8h}{Sqlite\+Wrapper.\+h}\item 
libemb/src/Sqlite\+Wrapper.\+cpp\end{DoxyCompactItemize}
